Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code attributes to spring webflux controller spans and remove spring-webflux.handler.type #12887

Merged

Conversation

cuichenli
Copy link
Contributor

part of #7345

@cuichenli cuichenli requested a review from a team as a code owner December 13, 2024 05:39
@cuichenli cuichenli changed the title Add code attributes to spring webflux controller spans Add code attributes to spring webflux controller spans and remove spring-webflux.handler.type Dec 16, 2024
@trask
Copy link
Member

trask commented Dec 16, 2024

it looks like there's a checkstyle failure

@cuichenli
Copy link
Contributor Author

it looks like there's a checkstyle failure

sorry about that, fixed it in the latest change.

parameter.annotatedMethod == null
? val -> val.contains(INNER_HANDLER_FUNCTION_CLASS_TAG_PREFIX)
: val -> val.isEqualTo(TestController.class.getName())));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously used TestController is more useful than org.springframework.web.method.HandlerMethod that is reported after these changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now it reports TestController as class name and method name as handle, TestController does not have this method

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

…gent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/webflux/v5_0/server/SpringWebfluxTest.java

Co-authored-by: Trask Stalnaker <[email protected]>
@cuichenli cuichenli requested a review from laurit December 20, 2024 02:03
…nstrumentation into capture-code-attributes-spring-webflux
…uichenli/opentelemetry-java-instrumentation into capture-code-attributes-spring-webflux
Comment on lines +28 to +31
if (handler instanceof HandlerMethod) {
HandlerMethod handlerMethod = (HandlerMethod) handler;
return handlerMethod.getMethod().getName();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@trask trask merged commit ce2ec18 into open-telemetry:main Dec 20, 2024
55 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants